Settings_SourceAnalysis.m 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. % ADVANCED SETTINGS FOR SOURCE ANALYSIS: %
  3. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  4. %
  5. % This settings file will be read by the BuilderGUI.
  6. % - Settings here will be loaded into the Builder .mat and applied to analysis.
  7. %
  8. % Usage:
  9. % a) Settings under "DO NOT EDIT" are handled by [MEG]PLS. Do not alter these.
  10. % b) Change other values as needed. See "help" command for FieldTrip section.
  11. % c) Optional settings can be uncommented and specified.
  12. %
  13. function [cfgSource, cfgInterpSrc, cfgWriteSrc, cfgSrcAvg] = Settings_SourceAnalysis(InputFTcfg)
  14. % DO NOT EDIT:
  15. cfgSource = InputFTcfg.Source;
  16. %--- "FT_SOURCEANALYSIS" SETTINGS: ---%
  17. %-------------------------------------%
  18. % DO NOT EDIT:
  19. cfgSource.method = InputFTcfg.Source.method;
  20. cfgSource.vol = [];
  21. cfgSource.grid = []; % Precomputed leadfield & filter used.
  22. cfgSource.(cfgSource.method).keepfilter = 'no'; % Turned on for source-filter calc.
  23. cfgSource.(cfgSource.method).keepmom = 'yes';
  24. cfgSource.(cfgSource.method).keepcsd = 'yes';
  25. cfgSource.(cfgSource.method).projectnoise = 'yes';
  26. cfgSource.(cfgSource.method).feedback = 'text';
  27. cfgSource.channel = 'MEG';
  28. if ismember(InputFTcfg.Source.method, {'lcmv', 'dics', 'pcc'})
  29. cfgSource.(cfgSource.method).fixedori = 'no'; % Keep as vector output
  30. end
  31. if strcmp(InputFTcfg.Source.method, 'sam')
  32. cfgSource.(cfgSource.method).fixedori = 'spinning'; % Options: spinning, robert, gareth
  33. end
  34. % GENERAL SETTINGS:
  35. cfgSource.rawtrial = 'no'; % Construct filter from single trials, apply to single trials.
  36. cfgSource.keeptrials = 'no'; % If 'yes', then need rawtrial to be 'yes' as well.
  37. cfgSource.keepleadfield = 'no'; % Note: rawtrial & keeptrial are disabled for filter calculation
  38. % OPTIONAL SETTINGS:
  39. % cfgSource.(cfgSource.method).lambda = number, percentage-string (Ex: '5%'), or empty
  40. % cfgSource.frequency = single number (in Hz)
  41. % cfgSource.latency = single number in seconds, for time-frequency analysis
  42. % cfgSource.refchan = reference channel label (for coherence)
  43. % cfgSource.refdip = reference dipole location (for coherence)
  44. % cfgSource.supchan = suppressed channel label(s)
  45. % cfgSource.supdip = suppressed dipole location(s)
  46. % OPTIONAL STATISTICS:
  47. % cfgSource.jackknife = 'no' or 'yes' jackknife resampling of trials
  48. % cfgSource.pseudovalue = 'no' or 'yes' pseudovalue resampling of trials
  49. % cfgSource.bootstrap = 'no' or 'yes' bootstrap resampling of trials
  50. % cfgSource.numbootstrap = number of bootstrap replications (e.g. number of original trials)
  51. % cfgSource.randomization = 'no' or 'yes'
  52. % cfgSource.permutation = 'no' or 'yes'
  53. % cfgSource.numrandomization = number, e.g. 500
  54. % cfgSource.numpermutation = number, e.g. 500 or 'all'
  55. % MANUAL GRAD. DEFINITION (NOT REQUIRED FOR NORMAL USE):
  56. % cfgSource.elec = structure with electrode positions, see FT_DATATYPE_SENS
  57. % cfgSource.grad = structure with gradiometer definition, see FT_DATATYPE_SENS
  58. % cfgSource.elecfile = name of file containing the electrode positions, see FT_READ_SENS
  59. % cfgSource.gradfile = name of file containing the gradiometer definition, see FT_READ_SENS
  60. % SETTINGS IF NO PRECOMPUTED LEADFIELD (NOT REQUIRED FOR NORMAL USE):
  61. % cfgSource.reducerank = 2;
  62. % cfgSource.normalize = 'no';
  63. %--- "FT_SOURCEINTERPOLATE" SETTINGS FOR SOURCE: ---%
  64. %---------------------------------------------------%
  65. % Note: This section determines how non-normalised source files are
  66. % interpolated and what parameter is written out into NIFTI format.
  67. % GENERAL SETTINGS:
  68. cfgInterpSrc.downsample = 1;
  69. cfgInterpSrc.interpmethod = 'nearest';
  70. cfgInterpSrc.parameter = 'avg.OutputStat'; % String or cell-array of field(s) to be interpolated.
  71. % If empty, will set to interpolate all volume fields.
  72. %--- "FT_VOLUMEWRITE" SETTINGS FOR INTERPOLATED SOURCES: ---%
  73. %-----------------------------------------------------------%
  74. % Note: This section determines how non-normalised source files
  75. % are written out into NIFTI format.
  76. % Warning: This section controls what parameter is written out into NIFTI for RAW sources.
  77. % For write settings to NORMALISED sources, see "Settings_SourceNormalise".
  78. % DO NOT EDIT:
  79. cfgWriteSrc.filename = []; % Handled by pipeline.
  80. cfgWriteSrc.filetype = 'nifti'; % Currently hardcoded for NIFTI.
  81. % GENERAL SETTINGS:
  82. cfgWriteSrc.downsample = 1;
  83. cfgWriteSrc.parameter = cfgInterpSrc.parameter;
  84. cfgWriteSrc.datatype = 'double';
  85. cfgWriteSrc.scaling = 'no';
  86. % OPTIONAL SETTINGS:
  87. % cfgWriteSrc.fiducial.nas = [x y z] position of nasion
  88. % cfgWriteSrc.fiducial.lpa = [x y z] position of LPA
  89. % cfgWriteSrc.fiducial.rpa = [x y z] position of RPA
  90. % cfgWriteSrc.markfiducial = 'yes' or 'no', mark the fiducials
  91. % cfgWriteSrc.markorigin = 'yes' or 'no', mark the origin
  92. % cfgWriteSrc.markcorner = 'yes' or 'no', mark the first corner of the volume
  93. %--- "FT_SOURCEGRANDAVERAGE" SETTINGS: ---%
  94. %-----------------------------------------%
  95. % Note: This section controls group-averaging settings in the pipeline, and determines
  96. % what parameters are group-averaged after normalisation.
  97. cfgSrcAvg.parameter = cfgInterpSrc.parameter;
  98. cfgSrcAvg.keepindividual = 'no';